<?php
class Registerfastival extends CI_Model{
    function __construct(){
        parent::__construct();
    }
    
     /** 
     * Insert data for config
     * @author phuc.duong
     */
    public function getList($start = 0, $limit ){
        $this->db->select();
        $this->db->from('register_fastival');
        $this->db->order_by('register_fastival.CreatedDate DESC');
        
        //set limit
        $this->db->limit($limit, $start);
        
        $query = $this->db->get();
        $res = $query->result_array();
        //echo $this->db->last_query(); die;
        return $res;
    }
    
     /** 
     * Insert data for config
     * @author phuc.duong
     */
    public function getCount(){
        $this->db->select();
        $this->db->from('register_fastival');
        $query = $this->db->get();
        $res = $query->num_rows();
        return $res;
    }
    
        
    /**
     * Get product by product id
     * @author phuc.duong
     */
    public function getRegister($registerFastivalId){
        $query = $this->db->get_where('register_fastival', array('RegisterFastivalId' => $registerFastivalId));
        $contact = $query->row_array();
        return $contact;
    }
    
    
    /**
     * Delete customer
     * @author phuc.duong
     */
    public function delete($registerFastivalId){
        return $this->db->delete('register_fastival', array('RegisterFastivalId' => $registerFastivalId));
    }
   
 }
 ?>